﻿using System;
using UnityEngine;

namespace PlaygroundSplines
{
	// Token: 0x0200014B RID: 331
	[Serializable]
	public class TransformNode
	{
		// Token: 0x06000727 RID: 1831 RVA: 0x0002A714 File Offset: 0x00028914
		public virtual bool Update(Transform splineTransform)
		{
			if (this.enabled && this.transform != null)
			{
				this.previousPosition = this.position;
				this.position = this.transform.position;
				this.inversePosition = splineTransform.InverseTransformPoint(this.transform.position);
				this.isAvailable = true;
				return true;
			}
			this.isAvailable = false;
			return false;
		}

		// Token: 0x06000728 RID: 1832 RVA: 0x0002A784 File Offset: 0x00028984
		public virtual bool IsAvailable()
		{
			return this.enabled && this.isAvailable;
		}

		// Token: 0x06000729 RID: 1833 RVA: 0x0002A79C File Offset: 0x0002899C
		public virtual Vector3 GetPosition()
		{
			return this.position;
		}

		// Token: 0x0600072A RID: 1834 RVA: 0x0002A7A4 File Offset: 0x000289A4
		public virtual Vector3 GetInvsersePosition()
		{
			return this.inversePosition;
		}

		// Token: 0x0600072B RID: 1835 RVA: 0x0002A7AC File Offset: 0x000289AC
		public virtual void SetPosition(Vector3 newPosition)
		{
			if (this.transform == null)
			{
				return;
			}
			this.transform.position = newPosition;
		}

		// Token: 0x0600072C RID: 1836 RVA: 0x0002A7CC File Offset: 0x000289CC
		public virtual void Translate(Vector3 translation)
		{
			if (this.transform == null)
			{
				return;
			}
			this.transform.position += translation;
		}

		// Token: 0x0600072D RID: 1837 RVA: 0x0002A7F8 File Offset: 0x000289F8
		public virtual Vector3 GetPositionDelta()
		{
			return this.previousPosition - this.position;
		}

		// Token: 0x04000724 RID: 1828
		public bool enabled;

		// Token: 0x04000725 RID: 1829
		public Transform transform;

		// Token: 0x04000726 RID: 1830
		protected bool isAvailable;

		// Token: 0x04000727 RID: 1831
		protected Vector3 position;

		// Token: 0x04000728 RID: 1832
		protected Vector3 inversePosition;

		// Token: 0x04000729 RID: 1833
		protected Vector3 previousPosition;
	}
}
